//
// Created by wze-zero on 2024/9/13 013.
//
#include <iostream>

using namespace std;

int main() {
    int num, sum = 0;
    cin >> num;
    while (num != 0) {
        sum += num % 10;
        num = num / 10;
    }
    cout << sum << endl;
    return 0;
}